﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using EraNet.Services.SysManage;
using EraNet.Core.Model.Account;
using EraNet.Services.Drivings;
using EraNet.WebApp.AppCore;

namespace EraNet.WebApp.IMS
{
    public class SystemController : IMSBasePage
    {

        #region Fields
        private readonly ISysCardsService _syscardService;
        private readonly IDriveSchoolService _driveschoolService;
        #endregion

        #region Constructors
        public SystemController(ISysCardsService syscardService,IDriveSchoolService driveschoolService)
        {
            this._syscardService = syscardService;
            this._driveschoolService = driveschoolService;
        }
        #endregion


        public ActionResult CardManager(string cardNo,int page=1)
       {
           page = page - 1;
           #region 获取当前驾校卡片信息
           Employee m = _driveschoolService.GetLoginClient();
           //var list= _examinationService.GetExamLogsBySchool(m.SchoolID, (int)page, 20);
           int TotalCount = 0;
           int PageSize = 20;
           var dataTable = _syscardService.GetCardsBySchoolId(m.SchoolID, cardNo, page, PageSize, out TotalCount);

           ViewData["TotalCount"] = TotalCount;
           ViewData["PageSize"] = PageSize;
           ViewData["PageIndex"] = page;

           #endregion
           return View(dataTable);
       }
    }
}
